package cars

import (
	"github.com/flipped-aurora/gin-vue-admin/server/api/v1"
	"github.com/flipped-aurora/gin-vue-admin/server/middleware"
	"github.com/gin-gonic/gin"
)

type CarRouter struct {
}

// InitCarRouter 初始化 car表 路由信息
func (s *CarRouter) InitCarRouter(Router *gin.RouterGroup) {
	carRouter := Router.Group("car").Use(middleware.OperationRecord())
	carRouterWithoutRecord := Router.Group("car")
	var carApi = v1.ApiGroupApp.CarsApiGroup.CarApi
	{
		carRouter.POST("createCar", carApi.CreateCar)   // 新建car表
		carRouter.DELETE("deleteCar", carApi.DeleteCar) // 删除car表
		carRouter.DELETE("deleteCarByIds", carApi.DeleteCarByIds) // 批量删除car表
		carRouter.PUT("updateCar", carApi.UpdateCar)    // 更新car表
	}
	{
		carRouterWithoutRecord.GET("findCar", carApi.FindCar)        // 根据ID获取car表
		carRouterWithoutRecord.GET("getCarList", carApi.GetCarList)  // 获取car表列表
	}
}
